package com.yycwxt.modules.admin.packfee;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yycwxt.domain.PackFee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PackFeeMapper extends BaseMapper<PackFee> {

    @Select("select * from dct_packfee;")
    List<PackFee> selectAll();

    @Select("select * from dct_packfee where id like concat('%',#{input},'%') or " +
            "type like concat('%',#{input},'%') or store_code like concat('%',#{input},'%') or  store_name like concat('%',#{input},'%') or fee like concat('%',#{input},'%');")
    List<PackFee> selectByInput(@Param("input") String input);

    @Insert("INSERT INTO dct_packfee(store_code, store_name, type, fee) VALUES (#{storeCode}, #{storeName}, #{type}, #{fee})")
    boolean add(PackFee packfee);

    @Select("SELECT value FROM sys_dictionary where name = '包装类型'")
    List<Object> findtype();
}
